<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8"/>
    <title>后台管理系统</title>
    <meta name="author" content="DeathGhost"/>
    <link rel="stylesheet" type="text/css" href="/admin/css/style.css">
    <!--[if lt IE 9]>
    <script src="/admin/js/html5.js"></script>
    <![endif]-->
    <script src="/admin/js/jquery.js"></script>
    <script src="/admin/js/jquery.mCustomScrollbar.concat.min.js"></script>
    <script>
        (function ($) {
            $(window).load(function () {

                $("a[rel='load-content']").click(function (e) {
                    e.preventDefault();
                    var url = $(this).attr("href");
                    $.get(url, function (data) {
                        $(".content .mCSB_container").append(data); //load new content inside .mCSB_container
                        //scroll-to appended content 
                        $(".content").mCustomScrollbar("scrollTo", "h2:last");
                    });
                });

                $(".content").delegate("a[href='top']", "click", function (e) {
                    e.preventDefault();
                    $(".content").mCustomScrollbar("scrollTo", $(this).attr("href"));
                });

            });
        })(jQuery);
    </script>
</head>

<body>
<!--header-->
<header>
    <div th:replace="admin/topBar::heater"></div>
</header>
<!--aside nav 开始-->

<aside class="lt_aside_nav content mCustomScrollbar">
    <div th:replace="admin/leftBar::left"></div>
</aside>
<!--aside nav结束-->

<section class="rt_wrap content mCustomScrollbar">
    <div class="rt_content">
        <div class="page_title">
            <h2 class="fl">商品列表</h2>
            <a href="product_detail.html" class="fr top_rt_btn add_icon">添加商品</a>
        </div>
        <section class="mtb">
            <form action="/Commodity/Something" method="post">
                <label>
                    <select name="classifyId" class="select">
                        <option value="0">分类查询</option>
                        <option th:each="classify : ${allClassify}" th:selected="${classifyId == classify.classifyId}"
                                th:text="${classify.classifyName}" th:value="${classify.classifyId}">
                        </option>
                    </select>
                </label>
                <input name="text" th:value="${string}" type="text" class="textbox textbox_225"
                       placeholder="输入商品关键词或商品编号..."/>
                <input type="submit" value="查询" class="group_btn"/>
            </form>
        </section>
        <table class="table">
            <tr>
                <th>缩略图</th>
                <th>商品编号</th>
                <th>商品名称</th>
                <th>单价</th>
                <th>分类</th>
                <th>库存</th>
                <th>操作</th>
            </tr>
            <div th:each="goods : ${allGoods}">
                <tr>
                    <td class="center"><img th:src=" '/Images' + ${goods.goods.getGoodsImg()}"
                                            src="/admin/upload/goods01.jpg" width="50"
                                            height="50"/></td>
                    <td class="center" th:text="${goods.goods.getGoodsId()}">A15902</td>
                    <td th:text="${goods.goods.getGoodsName()}">这里是产品名称</td>
                    <td class="center"><strong th:text="${goods.goods.getGoodsPrice()}" class="rmb_icon">59.00</strong>
                    </td>
                    <td class="center" th:text="${goods.goods.getClassify().getClassifyName()}">包</td>
                    <td class="center" th:text="${goods.goods.getGoodsInventory()}">5559</td>
                    <td class="center">
                        <a th:href="@{/Commodity/Update(goodsId=${goods.goods.goodsId})}" title="编辑" class="link_icon">&#101;</a>
                        <a th:href="@{/Commodity/ToComment(goodsId=${goods.goods.goodsId})}" title="查看评论"
                           class="link_icon">&#118;</a>
                    </td>
                </tr>
            </div>
        </table>
    </div>
</section>
</body>

</html>